package BlogTest.Polymorphic;

import java.net.PortUnreachableException;
import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: zhongyisheng
 * Date: 2024-07-03
 * Time: 18:31
 */


public class Test {
    public static void main(String[] args) {
        Animal animal = new Dog("旺财", 10);

        if(animal instanceof Dog){
            Dog dog = (Dog) animal;
            dog.eat();
        }else{
            System.out.println("animal instanceof Dog not");
        }

    }
}





















